/*******************************************************************************
 * Copyright 2011 Alexandre Zglav and Morphiastic
 * 
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * 
 *   http://www.apache.org/licenses/LICENSE-2.0
 * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 ******************************************************************************/
package com.morphiastic.tests;

import com.morphiastic.ElasticStore;
import com.morphiastic.ElasticStoreLifecycleListener;
import com.morphiastic.analysis.tokenizers.NGramTokenizer;



public class ElasticStoreLifeListenerTest1 implements ElasticStoreLifecycleListener{

	 

	@Override
	public void onAnalyzersLoaded(ElasticStore es, String indexName) {
		// TODO Auto-generated method stub
		
	}

	@Override
	public void onTokenizersLoaded(ElasticStore es, String indexName) {

		NGramTokenizer test = new NGramTokenizer("foobarTokeizer");
		test.setMinGram(3);
		test.setMaxGram(4);
		es.sendComponentDefinitionToServer(test);
		
		System.out.println("first one put");
		
		//this one will normally be aliased
		NGramTokenizer test2 = new NGramTokenizer("foobarTokeizer2foo");
		test2.setMinGram(3);
		test2.setMaxGram(4);
		es.sendComponentDefinitionToServer(test2);
	}

	@Override
	public void onFiltersLoaded(ElasticStore es, String indexName) {
		// TODO Auto-generated method stub
		
	}

	@Override
	public void onAnalysisComponentsLoaded(ElasticStore es, String indexName) {
		// TODO Auto-generated method stub
		
	}

	@Override
	public void onIndexCreated(ElasticStore es, String indexName) {
		// TODO Auto-generated method stub
		
	}

	@Override
	public void onElasticStoreReady(ElasticStore es, String indexName) {
		// TODO Auto-generated method stub
		
	}
	
}
